'use strict'

class  exchange{
  
  constructor () {

  }
  //得到动态列表
  async list (c) {
    let wuser = c.service.model.exchange
    let ulist = await wuser.list()
    c.send(ulist)
  }

  async post(c){
    let data=JSON.parse(c.body)
    let wuser = c.service.model.exchange
    let id=await wuser.insert(data)
    c.send(id)
  }

}

module.exports = exchange